TbsPolyglotManager Class

GetString method

The GetString method can be used to obtain a translation for a single string. Usually it is used for translating messages, but it can be used to obtain any translation from LNG file.

Syntax

function GetString(ASection, AStringName: string; ADefault: string = ''): string;

ASection - section name in the current LNG file to look for message;

AStringName - key name in specified section;

ADefault - will be returned as result if specified string not found;

Result - a value from specified key (AStringName) in specified section (ASection) from currently open LNG file. If specified string is not found then result is ADefault.

Example

// show message from section Messages with key name TestMessage.
MessageDlg(PolyglotManager.GetString('Messages', 'TestMessage'), mtInformation, [mbOk], 0);